﻿import QtQuick 2.0

import "../../js/util.js" as Util

Rectangle
{
    property int count
    property bool not_disturb:false
    width: {
        var value = Util.isMobileDevice()? m_lineValue*0.35 : 16
        if(count < 10) return value
        else if(count >= 10 && count <= 99) return value * 1.4
        else if(count > 99 && count <= 999) return value * 1.8
        else return value * 2.2
    }
    height: Util.isMobileDevice()? m_lineValue*0.35 : 16
    radius: height
    color: not_disturb?"#cccccc":"red"
    AText
    {
        color: "white"
        font.pixelSize: parent.height * 0.7
        text: count > 999 ? qsTr("999+") : count
        anchors.centerIn: parent
    }
}
